-
Notifications
You must be signed in to change notification settings - Fork 2.7k
React Native 0.78 support #8120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- code quality should be improved a bit, some changes need to be revisited.
- We must keep testing for regressions over RN 77, on CI - somehow
expect(tree.toJSON().children).toEqual(['Bob']); | ||
|
||
// Re-render to see the updated state | ||
rerender( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revisit whether this is indeed necessary
expect(tree.toJSON().children).toEqual(['Bob']); | ||
|
||
// Re-render to get updated content | ||
rerender(<MyConnectedComponent renderCountIncrement={renderCountIncrement} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revisit whether actually necessary
expect((tree.getInstance() as any)._reactInternalInstance.child.child.Fibernode.key).toEqual( | ||
'component1' | ||
); | ||
// Note: This test is disabled (xit) and uses deprecated React internals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to replace this with an equivalent expectation?
const mockComponent = { | ||
props: { componentId: 'doNotUseThisId' }, | ||
componentDidMount: jest.fn(), | ||
componentWillUnmount: jest.fn(), | ||
componentDidAppear: didAppearFn, | ||
componentWillAppear: jest.fn(), | ||
componentDidDisappear: jest.fn(), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const mockComponent = { | |
props: { componentId: 'doNotUseThisId' }, | |
componentDidMount: jest.fn(), | |
componentWillUnmount: jest.fn(), | |
componentDidAppear: didAppearFn, | |
componentWillAppear: jest.fn(), | |
componentDidDisappear: jest.fn(), | |
}; | |
const mockComponent = aComponent('doNotUseThisId'); |
return 'Hello'; | ||
} | ||
} | ||
// SimpleScreen is no longer used in tests - replaced with mock components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// SimpleScreen is no longer used in tests - replaced with mock components |
const mockComponent = { | ||
props: { componentId: 'test' }, | ||
componentDidMount: jest.fn(), | ||
componentWillUnmount: jest.fn(), | ||
componentDidAppear: didAppearFn, | ||
componentWillAppear: jest.fn(), | ||
componentDidDisappear: jest.fn(), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const mockComponent = { | |
props: { componentId: 'test' }, | |
componentDidMount: jest.fn(), | |
componentWillUnmount: jest.fn(), | |
componentDidAppear: didAppearFn, | |
componentWillAppear: jest.fn(), | |
componentDidDisappear: jest.fn(), | |
}; | |
const mockComponent = aComponent('test'); |
const mockComponent2 = { | ||
props: { componentId: 123 }, | ||
componentDidMount: jest.fn(), | ||
componentWillUnmount: jest.fn(), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const mockComponent2 = { | |
props: { componentId: 123 }, | |
componentDidMount: jest.fn(), | |
componentWillUnmount: jest.fn(), | |
}; | |
const mockComponent = aComponent(123); |
const tree2 = renderer.create(<SimpleScreen componentId={123} />); | ||
expect(() => uut.bindComponent(tree2.getInstance() as any)).toThrow(''); | ||
// Create a mock component instance for testing | ||
const mockComponent = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, why not keep SimpleScreen
instead of resorting to mocks here?
* Implemented dynamic pipelines * Implemented dynamic pipelines for rn 77 and 78
No description provided.